#!/usr/bin/env bash
#--------------------------------------------
# author：qierkang
# site：https://www.qekang.com
#--------------------------------------------
##### start #####
#
# by-service-worker 自动部署脚本文件
# sh by-service-worker.sh && by-service-thdp.sh && by-service-manage.sh && by-service-cust.sh && by-service-order.sh && by-service-job.sh && by-service-company.sh && by-service-cost.sh
##### end  #####
echo '所有ALL镜像打包启动中...'
sleep 2
echo '=============自动部署 by-service-gateway 脚本文件==========='
ssh root@by-test-mid-server "cd /root/projects/by366/ && git pull"
ssh -Tq root@by-test-mid-server <<remotessh
docker images|grep none|awk '{print $3 }'|xargs docker rmi
cd /root/projects/by366/configure/shell
sh by-service-gateway.sh
exit
remotessh
echo '=============自动部署 by-service-gateway 运行完毕==========='

sleep 2
echo '=============自动部署 所有依赖服务模块 脚本文件==========='
ssh root@by-test-service-server "cd /root/projects/by366/ && git pull"
ssh -Tq root@by-test-service-server <<remotessh
docker images|grep none|awk '{print $3 }'|xargs docker rmi
cd /root/projects/by366/configure/shell
sh by-service-worker.sh && by-service-thdp.sh && by-service-manage.sh && by-service-cust.sh && by-service-company.sh && by-service-cost.sh && by-service-core.sh && by-service-job.sh && by-service-appr.sh && by-service-wxmgr.sh&& by-service-supmgr.sh
exit
remotessh
echo '=============自动部署 所有依赖服务模块 运行完毕==========='
echo '所有ALL镜像打包完成'
